import { Login } from '@/model/login/Login';
import { useInjectable } from '@/unit/hooks/use-di';
import { observer } from 'mobx-react-lite';
import { useCallback } from 'react';
import RegisterView from './registerView';

export default observer(() => {
  const login = useInjectable(Login);

  const handleRegister = useCallback(() => {
    login.register();
  }, [login]);

  return (
    <RegisterView
      setPasswordAgain={login.setPasswordAgain}
      handleRegister={handleRegister}
      setPassword={login.setPassword}
      setName={login.setName}
    />
  );
});
